#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
#define inf 21000000000;
long long a[400010];
long long f[400010];
int q[400010];
int main(){
    int n,l,r;
    cin>>n>>l>>r;
    for(int i=0;i<=n;i++){
        cin>>a[i];
    }
    int head=0;
    int tail=0;
    for(int i=0;i<=n;i++){
        f[i]=-inf;
    }
    f[0]=0;
    long long ans=-inf;
    for(int i=l;i<=n;i++){
        while(head<tail&&f[i-l]>=f[q[tail-1]])tail--;
        tail++;
        q[tail-1]=i-l;//顺序
        while(head<tail&&(q[head]+r)<i)head++;
        f[i]=f[q[head]]+a[i];
        if(i+r>n){
            ans=max(ans,f[i]);
        }
    }
    cout<<ans;
    return 0;
}